Computing systems—i.e. devices capable of processing electronic data such as computers, telephones, Personal Digital Assistants (PDA), etc.—communicate with other computing systems by exchanging data according to a communications protocol that is recognizable by the systems. A system utilizes filters to analyze data that is sent and/or received by the system and to determine if and how the data will be processed further.
Filters are a set of one or more queries against which an input is tested. For purposes of the present discussion, the terms “filter” and “query” are singular and interchangeable, and multiple queries are said to comprise a “filter table.” One way filters are used is to allow an input into a system only if the input satisfies one or more particular filters. Another way filters are used is for message processing, such as with a mail program. Inputs that satisfy a filter associated with a particular mailbox are forwarded to the mailbox. Filters can also be used for file access algorithms, security controls, etc.
Filters are written in a suitable query language such as XPath or XQuery. Query languages are designed to operate on data structured according to a particular format. For example, XPath and XQuery are designed to operate on data structured as XML (eXtensible Markup Language). But sometimes, a filter designed to operate on data structured according to one format are called on to evaluate data structured according to another format. In such instances, a translation process must be performed so that the object can be tested against the filter. However, data transform procedures can consume significant resources.
Once such instance occurs when an XPath query is called on to evaluate a CLR (Common Language Runtime) or Java object. A typical way to perform this evaluation is to serialize the object and then use the serialized data to build a template of the object according to XML. The XPath query can then be evaluated against the object using the XML structure.
But the serialization process is expensive because it involves maintaining buffers, writing strings, etc. The resultant XML must then be parsed to build (typically) a DOM. Furthermore, an object is often at the root of a tree/graph of objects and can have references to other objects. Therefore, serializing an object can sometimes involve serializing multiple objects which adds to the overhead required for processing.